 ///
 /// @file    log4cppTest.cc
 /// @author  lemon(haohb13@gmail.com)
 /// @date    2016-03-02 15:34:58
 ///

#include <iostream>
#include <log4cpp/Category.hh>
#include <log4cpp/Appender.hh>
#include <log4cpp/OstreamAppender.hh>
#include <log4cpp/Layout.hh>
#include <log4cpp/BasicLayout.hh>
#include <log4cpp/Priority.hh>

int main(void)
{
	log4cpp::Appender * appender = 
		new log4cpp::OstreamAppender("console", &std::cout);

	appender->setLayout(new log4cpp::BasicLayout());

	log4cpp::Category & root = log4cpp::Category::getRoot();
	root.setPriority(log4cpp::Priority::DEBUG);
	root.setAppender(appender);

	root.error("root error");
	root.info("root info");
	root.warn("%d + %d = %s", 1, 1, "two");


	return 0;
}
